realtek: mdio-serdes: improve debugfs creation
authorJonas Jelonek <[email protected]>
Tue, 16 Dec 2025 10:20:13 +0000 (10:20 +0000)
committerRobert Marko <[email protected]>
Tue, 16 Dec 2025 12:11:34 +0000 (13:11 +0100)
commit8e4730fd60a1b4998d1c9c07aeb6c6a27bce210f
tree2cb78b69b0f963713771123e7b636b5fc3ed8ce8
parent3045f205b379b160af3b3af16fc976cc216f0248
realtek: mdio-serdes: improve debugfs creation

Commit 3c073b5cb2 cleaned up the debugfs creation in
mdio-realtek-otto-serdes driver to not explicitly check if the root
directory already exists. This is fine because kernel handles the case
properly so there's no need to check anymore.

However, this pollutes the boot log with:
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'

Now, the root directory creation is attempted multiple times, causing
the kernel to print an error message because the directory already
exists.

Fix this by moving the SerDes loop into rtsds_debug_init and only try
to create the root debugfs directory once.

Signed-off-by: Jonas Jelonek <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21179
Signed-off-by: Robert Marko <[email protected]>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c